$editing-bg = #ecf0f1
$editing-border = darken($editing-bg, 7%)

[class^="fb-icon-"]:before, [class*=" fb-icon-"]:before {
  font-family: "fontello";
  font-style: normal;
  font-weight: normal;
  speak: none;

  display: inline-block;
  text-decoration: inherit;
  width: 1em;
  margin-right: .2em;
  text-align: center;
  /* opacity: .8; */

  /* For safety - reset parent styles, that can break glyph codes*/
  font-variant: normal;
  text-transform: none;

  /* fix buttons height, for twitter bootstrap */
  line-height: 1em;

  /* Animation center compensation - margins should be symmetric */
  /* remove if not needed */
  margin-left: .2em;

  /* you can be more comfortable with increased icons size */
  /* font-size: 120%; */

  /* Uncomment for 3D effect */
  /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}


.fb-icon-date:before {
  content: '\f133';
}

/* '' */
.fb-icon-radio:before {
  content: '\f192';
}

/* '' */
.fb-icon-checkbox:before {
  content: '\e893';
}

/* '' */
.fb-icon-data-source:before {
  content: '\f1c0';
}

/* '' */
.fb-icon-dropdown:before {
  content: '\e854';
}

/* '' */
.fb-icon-signature:before {
  content: '\e830';
}

/* '' */
.fb-icon-info:before {
  content: '\f129';
}

/* '' */
.fb-icon-table:before {
  content: '\f0ce';
}

/* '' */
.fb-icon-textarea:before {
  content: '\f1dd';
}

/* '' */
.fb-icon-section:before {
  content: '\f2d1';
}

/* '' */
.fb-icon-text:before {
  content: '\e87d';
}

/* '' */
.fb-icon-number:before {
  content: '\f162';
}

/* '' */
.fb-icon-time:before {
  content: '\e84a';
}

/* '' */
.fb-icon-conditional:before {
  content: '\E824';
}

/* '' */
.fb-icon-geolocation:before {
  content: '\e839';
}

/* '' */
.fb-icon-approval:before {
  content: '\f14b';
}

/* '' */
.fb-icon-grid:before {
  content: '\e810'
}

.fb-button {
  text-align: left;
}


.fb-clear {
  clear: both;
}

.fb-main {
  padding: 0 20px 0 0;
  position: relative;
}

.fb-save-wrapper {
  position: absolute;
  right: 20px;
  top: 10px;
}

.fb-left {
  float: left;
  width: 320px;
  padding-top: 30px;
}

.fb-right {
  padding-top: 70px;
  margin-left: 320px;
  border-left: 1px solid #ddd;
  padding-left: 20px;
  padding-bottom: 150px;
  min-height: 100%;
  overflow: hidden;
}

.fb-no-response-fields {
  color: #999;
}

.fb-tabs {
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0 0 0 20px;
  border-bottom: 1px solid #ccc;
}

.fb-tabs li {
  display: inline-block;
}

.fb-tabs li a {
  display: block;
  padding: 10px;
  border-radius: 5px 5px 0 0;
  font-size: 13px;
  cursor: pointer;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}


.fb-tabs li.active a {
  border: 1px solid #ccc;
  margin-bottom: -1px;
  border-bottom-color: #fff;
}

.fb-tab-content .fb-tab-pane {
  padding: 0 20px;
  display: none;
}

.fb-tab-content .fb-tab-pane.active {
  display: block;
}

.fb-add-types .section {
  padding-bottom: 5px;
  margin-bottom: 20px;
}

.fb-add-types {
  font-size: 0;
  /* Inline block fix */
}

.fb-add-types a {
  font-size: 13px;
  display: inline-block;
  width: 48.5%;
  margin-bottom: 9px;
  box-sizing: border-box;


  &:nth-child(odd) {
    margin-right: 3%;
  }

  .symbol {
    opacity: .6;
    margin: 0 .25em 0 -1em;
  }
}

.fb-response-fields {
  padding-bottom: 150px;
}

.fb-response-fields a.sortable-placeholder {
  display: block;
  border: 1px dashed #ddd;
  min-height: 80px;
  height: 80px;
  width: 100%;
}

/* Field */

.fb-field-wrapper {
  cursor: pointer;
  position: relative;
  margin-bottom: 20px;

  input {
    border-radius: 3px;
    border: thin solid #ddd;
  }
}

.fb-field-wrapper:hover .actions-wrapper, .fb-field-wrapper.editing .actions-wrapper {
  display: block;
}

.fb-field-wrapper:hover .subtemplate-wrapper {
  border-color: #ddd;
  border-radius: 3px;
}

/* Editing */

.fb-field-wrapper.editing {
  background-color: $editing-bg;
  border-radius: 3px;
  box-shadow: inset 0 0 7px 2px rgba(100, 100, 100, 0.1);
  border: 1px solid rgba(100, 100, 100, 0.2);
}

.fb-field-wrapper.parent {
  box-shadow: rgba(0, 0, 0, 0.3) 1px 1px 10px;
}


.fb-field-wrapper.editing .subtemplate-wrapper {
  border-color: $editing-border;
  border-style: solid;
  margin: 0;
  border-radius: 3px;
}

.fb-field-wrapper .actions-wrapper {
  display: none;
  position: absolute;
  bottom: -7px;
  right: 5px;
  z-index: 3;
}

.fb-field-wrapper .actions-wrapper a {
  display: inline-block;
  background-color: #ccc;
  padding: 2px 8px;
}


.edit-response-field {
  input, textarea, select {
    border: thin solid #ddd;
    border-radius: .25em;
    padding: .5em;
    display: inline-block;
    height: auto;
    vertical-align: middle;

    &:focus {
      outline: none;
    }
  }

  select {
    font-size: 14px;
    max-width: 100%;
  }
}

input[readonly] {
  cursor: not-allowed;
  background-color: #eeeeee;
}


.fb-field-wrapper .subtemplate-wrapper {
  border: 1px dashed transparent;
  margin-bottom: 10px;
  padding: 10px;
  position: relative;
}

.fb-field-wrapper .subtemplate-wrapper .cover {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 2;
}

.fb-field-wrapper .subtemplate-wrapper > label {
  display: block;
  border-bottom: thin solid #eee;
  padding-bottom: 3px;
  margin-bottom: 7px;
}

.fb-field-wrapper .subtemplate-wrapper abbr {
  color: #f00;
}

.fb-field-wrapper .input-line {
  clear: both;
  margin-bottom: 10px;
}

.fb-field-wrapper .input-line .above-line {
  margin-top: 7px;
}

.fb-field-wrapper .input-line > span {
  display: inline-block;
  vertical-align: top;
}

.fb-field-wrapper .input-line > span input {
  width: 100%;
}

.fb-field-wrapper .input-line > span > label {
  display: block;
  font-size: 13px;
  margin-left: 3px;
}

.fb-field-wrapper .help-block {
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.fb-edit-field-wrapper {
  font-size: 13px;
}

.fb-edit-field-wrapper .fb-field-label {
  font-weight: normal;
  background: #eee;
  padding: .75em;
  color: #666;
  font-size: 1.25em;

  .type {
    margin-top: .5em;
    display: block;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1em;

    &:before {
      content: 'Type: ';
      color: #999;
    }
  }

  .fa.fa-arrow-right {
    display: none;
  }
}

.fb-edit-field-wrapper .fb-edit-section-header {
  border-bottom: 1px solid #ddd;
  margin-top: 25px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  clear: both;
  font-weight: 700;
}

.fb-edit-field-wrapper .js-add-option, .fb-edit-field-wrapper .js-remove-option {
  padding: 3px 6px;
}

.fb-edit-field-wrapper .fb-bottom-add {
  margin-top: 8px;
}

.fb-common-wrapper .fb-label-description {
  margin-bottom: 10px;
}

.fb-common-wrapper .fb-label-description input, .fb-common-wrapper .fb-label-description textarea {
  width: 100%;
}

.fb-common-wrapper .fb-label-description textarea {
  min-height: 5em;
}

.fb-conditional-question {
  float: right;
  font-size: .9em;
  max-width: 50%;
  text-overflow: ellipsis;
  height: 20px;
  white-space: nowrap;
  overflow: hidden;
}

.fb-conditional-question-trigger > span {
  font-weight: bold;
}

.option-score-input {
  width: 50px;
}

.option-label-input {
  width: 170px;
}

.response-field-draggable-helper {
  border: 1px dashed #ddd;
  background: #eee;
}

.response-field-text input.rf-size-small {
}

.response-field-text input.rf-size-medium {
  width: 300px;
}

.response-field-text input.rf-size-large {
  width: 100%;
}

.response-field-textarea textarea.rf-size-small {
  width: 200px;
  min-height: 60px;
}

.response-field-textarea textarea.rf-size-medium {
  width: 400px;
  min-height: 100px;
}

.response-field-textarea textarea.rf-size-large {
  width: 100%;
  min-height: 200px;
}

.response-field-address .street {
  width: 400px;
}

.response-field-address .city, .response-field-address .state, .response-field-address .zip, .response-field-address .country {
  width: 198px;
}

.response-field-date .month, .response-field-date .day, .response-field-date .year {
  width: 50px;
}

.response-field-time .input-group {
  width: 145px;
}

.response-field-checkbox .fb-option, .response-field-radio .fb-option {
  margin-bottom: 5px;
  padding: 3px 8px;
  display: inline-block;
}

.fb-option {

}

.editing .trigger-option, .fb-option.trigger-option {
  background-color: #5cb85c;
  border-radius: 0.25em;
  color: white;
}

.fb-conditional-question .trigger-option {
  padding: 1px 4px;
}

.response-field-website input {
  width: 200px;
}

.response-field-signature .fb-signature {
  width: 300px;
  height: 150px;
}

.response-field-signature .fb-signature-placeholder {
  color: #AAA;
}
.response-field-approval .fb-approval-user {
  margin-bottom 20px
}
.response-field-approval .fb-signature {
  width: 300px;
  height: 150px;
}

.response-field-approval .fb-signature-placeholder {
  color: #AAA;
}


.response-field-grid {
  .cover {
    display: none;
  }
}

.response-field-table {
  width: 100%

  .cover {
    display: none;
  }

  .section-name {
    display: inline-block;
  }

  .element-selector {
    margin: 0 5px;
    float: right;
    position: absolute;
    right: 5px;
    top: 5px;
  }

  tr {
    vertical-align: top;
  }


  table {
    margin-bottom: 30px;

    td {
      padding: 10px 10px 0 10px

      label {
        border: none !important;
      }
    }

    .calculated {
      font-style: italic;
      color: #ccc;
    }

    select, input[type=text], textarea, .fb-signature {
      width: 100%;
    }
  }
}

for row in (1..15)
  .fb-options-per-row-{row}:before
    content " "
    display table
  .fb-options-per-row-{row}:after
    content " "
    display table
    clear both
  .fb-options-per-row-{row}
    clear both

    .fb-option-wrapper
      width (100% / row)


.response-field-grid-table {
  border-collapse: collapse;
  border-spacing: 0;
  margin-bottom: 5px;
  table-layout: fixed;
  width: 100%;

  .response-field-grid-row {
    height: 100px;
    vertical-align: top;
  }

  td {
    padding: 10px 10px 0 10px;
  }

  .element-selector {
    width: 100%;

    .dropdown-toggle {
      width: 100%;

      span {
        font-size: 2em;
      }
    }
  }

  .response-field-grid-cell {
    padding: 10px 10px 0 10px;
    border: 1px dashed #ddd
    background-color: rgba(255, 255, 255, 0.8);

    .cover {
      display: block;
    }

    .response-field-selector {
      margin: 0.5em;
    }

    .subtemplate-wrapper > label {
      display: none;
    }

    .help-block {
      display: none;
    }

    select, input[type=text], textarea, .fb-signature {
      width: 100%;
    }
  }
}


.section-separator {
    border-top: 1px solid #333;
}

.fb-link-object-fields {
  padding: 15px;
}
